package com.fwj.hashmapexample;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.SortedMap;

/**
 * Project Name: fwj
 * Author: fhw
 * File Name: HashMapExample
 * Package Name: com.fwj.hashmapexample
 * Date: 2020/4/27 下午11:43
 * Copyright (c) 2020,All Rights Reserved.
 */
public class HashMapExample {
    public static void main(String[] args) {


        HashMap map = new HashMap();
        map.put("name","wj");
        map.put("sex","1");
        System.out.println(map.toString());

        System.out.println(1 << 4);
        System.out.println(1 << 30);


        LinkedHashMap linkedHashMap = new LinkedHashMap();


//        SortedMap sortedMap = new SortedMap();



        TestHashMapHashCode();
    }

    public static void TestHashMapHashCode () {
        HashMapExample example= new HashMapExample();
        example.put("name","黄飞鸿");
        example.put("id","1");
        example.put("sex","1");
        example.put("birthday","1988");
    }

    public void put(String key, String value) {
        System.out.printf("key:%s----hashcode:%s----mo: %s\r\n",key,key.hashCode(),Math.abs(key.hashCode()%15));

    }
}
